/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ui;

import font.MyFont;

/**
 *
 * @author kien.tran
 */
public abstract class AItem {

    
    protected MyFont font;
    protected ACanvas parent;
    protected String id;
    protected int x;
    protected int y;
    protected int width;
    protected int height;
    protected boolean focus = false;
    protected boolean visible = true;

    public AItem() {
    }

    public AItem(String id, int x, int y, int width, int height, boolean focus, boolean visible) {
        this.id = id;
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.focus = focus;
        this.visible = visible;
    }

    public boolean isFocus() {
        return focus;
    }

    public void setFocus(boolean focus) {
        this.focus = focus;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean isVisible() {
        return visible;
    }

    public void setVisible(boolean visible) {
        this.visible = visible;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public void setParent(ACanvas parent) {
        if (parent != null) {
            this.parent = parent;
            this.font = parent.getFont();
            this.width = parent.getItemWidth();
            this.height = font.getFontNormal().getHeight();
        }
    }

    public ACanvas getParent() {
        return parent;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public MyFont getFont() {
        return font;
    }

    public void setFont(MyFont font) {
        this.font = font;
    }
}
